Optimal. Leaf size=34 \[ -\frac {a^2 x^{-2 n}}{2 n}-\frac {2 a b x^{-n}}{n}+b^2 \log (x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.02, antiderivative size = 34, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {266, 43} \[ -\frac {a^2 x^{-2 n}}{2 n}-\frac {2 a b x^{-n}}{n}+b^2 \log (x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 43
Rule 266
Rubi steps
\begin {align*} \int x^{-1-2 n} \left (a+b x^n\right )^2 \, dx &=\frac {\operatorname {Subst}\left (\int \frac {(a+b x)^2}{x^3} \, dx,x,x^n\right )}{n}\\ &=\frac {\operatorname {Subst}\left (\int \left (\frac {a^2}{x^3}+\frac {2 a b}{x^2}+\frac {b^2}{x}\right ) \, dx,x,x^n\right )}{n}\\ &=-\frac {a^2 x^{-2 n}}{2 n}-\frac {2 a b x^{-n}}{n}+b^2 \log (x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.04, size = 28, normalized size = 0.82 \[ b^2 \log (x)-\frac {a x^{-2 n} \left (a+4 b x^n\right )}{2 n} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.59, size = 38, normalized size = 1.12 \[ \frac {2 \, b^{2} n x^{2 \, n} \log \relax (x) - 4 \, a b x^{n} - a^{2}}{2 \, n x^{2 \, n}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.18, size = 38, normalized size = 1.12 \[ \frac {2 \, b^{2} n x^{2 \, n} \log \relax (x) - 4 \, a b x^{n} - a^{2}}{2 \, n x^{2 \, n}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.02, size = 43, normalized size = 1.26 \[ \left (b^{2} {\mathrm e}^{2 n \ln \relax (x )} \ln \relax (x )-\frac {2 a b \,{\mathrm e}^{n \ln \relax (x )}}{n}-\frac {a^{2}}{2 n}\right ) {\mathrm e}^{-2 n \ln \relax (x )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.54, size = 34, normalized size = 1.00 \[ b^{2} \log \relax (x) - \frac {a^{2}}{2 \, n x^{2 \, n}} - \frac {2 \, a b}{n x^{n}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.33, size = 34, normalized size = 1.00 \[ b^2\,\ln \relax (x)-\frac {a^2}{2\,n\,x^{2\,n}}-\frac {2\,a\,b}{n\,x^n} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 57.24, size = 235, normalized size = 6.91 \[ \begin {cases} a^{2} x + 4 a b \sqrt {x} + b^{2} \log {\relax (x )} & \text {for}\: n = - \frac {1}{2} \\\left (a + b\right )^{2} \log {\relax (x )} & \text {for}\: n = 0 \\- \frac {2 a^{2} n}{4 n^{2} x^{2 n} + 2 n x^{2 n}} - \frac {a^{2}}{4 n^{2} x^{2 n} + 2 n x^{2 n}} - \frac {8 a b n x^{n}}{4 n^{2} x^{2 n} + 2 n x^{2 n}} - \frac {4 a b x^{n}}{4 n^{2} x^{2 n} + 2 n x^{2 n}} + \frac {4 b^{2} n^{2} x^{2 n} \log {\relax (x )}}{4 n^{2} x^{2 n} + 2 n x^{2 n}} + \frac {2 b^{2} n x^{2 n} \log {\relax (x )}}{4 n^{2} x^{2 n} + 2 n x^{2 n}} + \frac {2 b^{2} n x^{2 n}}{4 n^{2} x^{2 n} + 2 n x^{2 n}} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________